/**
 * Copyright (c) 2023 myons Inc. All rights reserved.
 */
package cn.zmwh.im.server.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @describe: 过滤器配置 、
 * @author: dmzmwh 、
 * @time: 2023-04-10 18:11 、
 */
@Configuration
public class FilterConfig {
    @Bean
    public ImServerGlobalFilter platformGlobalFilter() {
        return new ImServerGlobalFilter();
    }


    @Bean
    public FilterRegistrationBean filterRegistrationBean() {
        FilterRegistrationBean bean = new FilterRegistrationBean();
        bean.setFilter(platformGlobalFilter());
        bean.addUrlPatterns("/*");
//        bean.setOrder(Integer.MIN_VALUE);
        return bean;
    }
}

